<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="xbsj-labels" content="EarthUI示例"></meta>
    <title>高德地图纠偏</title>
    <script src="../../XbsjEarthUI/xbsj.js"></script>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="main">
    </div>

    <script>
        XbsjEarthUI.create('main').then(earthUI => {


            var earth = earthUI.earth;

            const g0 = new XE.SceneTree.Group(earth);
            g0.title = '纠偏测试'
            earth.sceneTree.root.children.push(g0);
            {
                var googleImageryLayer = new XE.Obj.Imagery(earth);
                googleImageryLayer.xbsjImageryProvider.type = 'XbsjImageryProvider';
                googleImageryLayer.xbsjImageryProvider['XbsjImageryProvider'] = {
                    url: '//webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
                    rectangle: [-Math.PI, -Math.PI * 0.5, Math.PI, Math.PI * 0.5],
                    srcCoordType: 'GCJ02',  //实时纠偏
                    dstCoordType: 'WGS84'
                };
                const so = new XE.SceneTree.Leaf(googleImageryLayer);
                so.title = '高德地图';
                g0.children.push(so);
            }

            // only for Debug
            window.uia = earthUI;
        });
    </script>
</body>

</html>